package com.tdam2011.grupo02.connectivity;

import android.content.Context;

public class ConnectivityInformationSingleton {

	private ConnectivityInformation connectivityInfo = null;
	private static ConnectivityInformationSingleton connectivityInfoSingleton = null;

	private ConnectivityInformationSingleton(Context context) {
		connectivityInfo = new ConnectivityInformation(context.getApplicationContext());
	}

	private static void createInstance(Context context) {
		if (connectivityInfoSingleton == null)
			connectivityInfoSingleton = new ConnectivityInformationSingleton(context);
	}

	public static ConnectivityInformationSingleton getInstance(Context context) {
		if (connectivityInfoSingleton == null)
			createInstance(context);

		return connectivityInfoSingleton;
	}

	public ConnectivityInformation getConnectivityInformation() {
		return connectivityInfo;
	}
}
